

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit Area</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="list" action="list">Area List</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">New Area</g:link></span>
        </div>
        <div class="body">
            <h1>Edit Area</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${areaInstance}">
            <div class="errors">
                <g:renderErrors bean="${areaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${areaInstance?.id}" />
                <input type="hidden" name="version" value="${areaInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="borrows">Borrows:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'borrows','errors')}">
                                    
<ul>
<g:each var="b" in="${areaInstance?.borrows?}">
    <li><g:link controller="bwhoa" action="show" id="${b.id}">${b?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="bwhoa" params="['area.id':areaInstance?.id]" action="create">Add Bwhoa</g:link>

                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="container">Container:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'container','errors')}">
                                    <g:select optionKey="id" from="${Container.list()}" name="container.id" value="${areaInstance?.container?.id}" ></g:select>
                                </td>
                            </tr> 
                       <!--
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="courses">Courses:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'courses','errors')}">
                                    <g:select name="courses"
from="${Course.list()}"
size="5" multiple="yes" optionKey="id"
value="${areaInstance?.courses}" />

                                </td>
                            </tr>
                       -->
                        <!--
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="employed">Employed:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'employed','errors')}">
                                    
<ul>
<g:each var="e" in="${areaInstance?.employed?}">
    <li><g:link controller="employee" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="employee" params="['area.id':areaInstance?.id]" action="create">Add Employee</g:link>

                                </td>
                            </tr> 
                        -->
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="labId">Area Id:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'areaId','errors')}">
                                    <input type="text" id="areaId" name="areaId" value="${fieldValue(bean:areaInstance,field:'areaId')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:areaInstance,field:'name')}"/>
                                </td>
                            </tr> 
                        <!--
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="projects">Projects:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'projects','errors')}">
                                    <g:select name="projects"
from="${Project.list()}"
size="5" multiple="yes" optionKey="id"
value="${areaInstance?.projects}" />

                                </td>
                            </tr>
                        -->
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">Type:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:areaInstance,field:'type','errors')}">
                                    <g:select optionKey="id" from="${Type.list()}" name="type.id" value="${areaInstance?.type?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
